package com.syh.jn.scm.infrastructure.repository.model.stock.stockLoss;

import com.syh.core.ddd.infrastructure.repository.model.SuperBusinessModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 仓库报损管理
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "T_STOCK_STOCK_LOSS")
@EqualsAndHashCode(callSuper = true)
public class StockLossModel extends SuperBusinessModel {
  /**
   * 报损单号
   */
  @Column(name = "LOSS_ORDER_CODE", columnDefinition = "varchar(50) COMMENT '报损单号'")
  private String lossOrderCode;
  /**
   * 对应单号
   */
  @Column(name = "ORIGINAL_ORDER_CODE", columnDefinition = "varchar(50) COMMENT '对应单号'")
  private String originalOrderCode;
  /**
   * 对应单id
   */
  @Column(name = "ORIGINAL_ORDER_Id", columnDefinition = "bigint COMMENT '对应单id'")
  private Long originalOrderId;
  /**
   * 单据状态(0：未确认 1：已确认 -1：已取消)
   */
  @Column(name = "STATUS", columnDefinition = "smallint COMMENT '状态：0未确认 1已确认 -1已取消'")
  private Short status;
  /**
   * 报损类型(1:销售运输报损 2:采购运输报损 3:销售退货运输报损 4:采购退货运输报损)
   */
  @Column(name = "LOSS_TYPE", columnDefinition = "smallint COMMENT '报损类型: 1销售运输报损 2采购运输报损 3销售退货运输报损 4采购退货运输报损'")
  private Short lossType;
  /**
   * 是否已生成记录(库存记录、应收付记录等)
   */
  @Column(name = "HAVE_RECORD", columnDefinition = "smallint COMMENT '是否已生成记录 0:未生成  1：已生成'")
  private Short haveRecord;
  /**
   * 仓库id
   */
  @Column(name = "STOREHOUSE_ID", columnDefinition = "bigint COMMENT '仓库id'")
  private Long storehouseId;
  /**
   * 报损时间(确认的时间)
   */
  @Column(name = "LOSS_DATE_TIMESTAMP", columnDefinition = "bigint COMMENT '报损时间(确认的时间)'")
  private Long lossDateTimestamp;
  /**
   * 备注
   */
  @Column(name = "REMARK", columnDefinition = "varchar(100) COMMENT '备注'")
  private String remark;
  /**
   * 报损总额
   */
  @Column(name = "TOTAL_AMOUNT", columnDefinition = "decimal(19,2) COMMENT '报损总额'")
  private BigDecimal totalAmount;
  /**
   * 客户id
   */
  @Column(name = "CUSTOMER_BUSINESS_ID", columnDefinition = "bigint COMMENT '客户id'")
  private Long customerBusinessId;
  /**
   * 录单人员id
   */
  @Column(name = "OPERATOR_ID", columnDefinition = "bigint COMMENT '录单人员id'")
  private Long operatorId;
  /**
   * 创建日期
   */
  @Column(name = "CREATE_TIME_STAMP", columnDefinition = "bigint COMMENT '创建日期'")
  private Long createTimeStamp;
  /**
   * 最后修改日期
   */
  @Column(name = "LAST_UPDATE_TIME_STAMP", columnDefinition = "bigint COMMENT '最后修改日期'")
  private Long lastUpdateTimeStamp;
  /**
   * 录单日期
   */
  @Column(name = "INPUT_DATE_TIMESTAMP", columnDefinition = "bigint COMMENT '录单日期'")
  private Long inputDateTimestamp;
  /**
   * 锁定状态(0 未锁定 1 已锁定 )确认后自动锁定，锁定后为最终状态，将不可再修改
   */
  @Column(name = "LOCK_STATUS", columnDefinition = "smallint COMMENT '锁定状态(0 未锁定 1 已锁定 )'")
  private Short lockStatus;
}
